<page-header [autoTitle]="false"></page-header>
<nz-card>
  <section class="search-section">
    <input nz-input placeholder="备注" [(ngModel)]="keyword" class="search-item"/>
    <button nz-button [nzType]="'primary'" nzGhost (click)="search()"  class="search-item">
      <i class="anticon anticon-search"></i><span>搜索</span>
    </button>
    <button nz-button [nzType]="'primary'" (click)="editEntity({})"  class="search-add-right">
      <i class="anticon anticon-plus"></i><span>添加</span>
    </button>
  </section>
  <nz-table #nzTable [nzData]="page.content"
            [nzPageSize]="page.size"
            [nzTotal]="page.totalElements"
            [nzFrontPagination]="false"
            [(nzPageIndex)]="page.number"
            (nzPageIndexChange)="changePageNo($event)"
            [nzLoading]="isLoading">
    <thead>
    <tr>
      <th nz-th><span>序号</span></th>
      <th nz-th><span>二维码</span></th>
      <th nz-th><span>今日已访问次数</span></th>
      <th nz-th><span>备注</span></th>
      <th nz-th><span>操作</span></th>
    </tr>
    </thead>
    <tbody>
    <tr *ngFor="let data of nzTable.data;let i=index">
      <td>
        {{i+1}}
      </td>
      <td  (click)="showPic(data.mainImg)" title="点击查看大图" style="cursor: pointer;"><img style="max-height: 100px;max-width: 100px;" src="{{data.mainImg}}" /></td>
      <td>{{data.dailyCount}}</td>
      <td title="{{data.remark}}">{{data.remark|stringEllipsisCutPipe:36}}</td>
      <td>
        <a href="javascript:void (0);" (click)="editEntity(data)">查看详情</a>
        <nz-divider nzType="vertical"></nz-divider>
         <nz-popconfirm [nzTitle]="'确定要删除这条数据吗？'" (nzOnConfirm)="delete(data)">
           <a nz-popconfirm>删除</a>
         </nz-popconfirm>
      </td>
    </tr>
    </tbody>
  </nz-table>
</nz-card>
<pic-viewer [picList]="picList" [picIdx]="0" [show]="isShowPic" (onClose)="onPicClose($event)"></pic-viewer>
